import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home/Home.vue'
import Login from '@/components/login/login.vue'
import Disc from '@/components/Disc/Disc.vue'
import Secret from '@/components/Secret/Secret.vue'
import Meet from '@/components/Meet/Meet.vue'
import WriteSecret from '@/components/WriteSecret/WriteSecret.vue'
import WriteSecretInput from '@/components/WriteSecretInput/WriteSecretInput.vue'
import UserCore from '@/components/UserCore/UserCore.vue'
import UserNews from '@/components/UserNews/UserNews.vue'
import UserCan from '@/components/UserCan/UserCan.vue'
import UserInformation from '@/components/UserInformation/UserInformation.vue'
import InteractionNotice from '@/components/InteractionNotice/InteractionNotice.vue'
import SystemNotice from '@/components/SystemNotice/SystemNotice.vue'
import ChatView from '@/components/ChatView/ChatView.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      children: [
        {
          path: '/meet',
          component: Meet
        },
        {
          path: '/list/:id',
          component: Disc,
          children: [
            {
              path: ':SecretId',
              component: Secret
            }
          ]
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/write',
      name: 'WriteSecret',
      component: WriteSecret,
      children: [
        {
          path: ':id',
          component: WriteSecretInput
        }
      ]
    },
    {
      path: '/user',
      name: 'user',
      component: UserCore,
      children: [
        {
          path: '/',
          component: UserNews
        },
        {
          path: 'news',
          component: UserNews,
          children: [
            {
              path: 'inter',
              component: InteractionNotice
            },
            {
              path: 'system',
              component: SystemNotice
            },
            {
              path: ':id',
              component: ChatView
            }
          ]
        },
        {
          path: 'can',
          component: UserCan
        },
        {
          path: 'info',
          component: UserInformation
        }
      ]
    }
  ]
})
